Skip to content

Made functions public #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Made functions public #49

wants to merge 1 commit into from

Conversation

dannylewis-sheffield
Copy link

So they can be used in other modules

@kylef
Copy link
Owner

kylef commented Dec 2, 2016

I'm not sure why you would want to manually call these functions. Could you perhaps explain your use-case?

@dannylewis-sheffield
Copy link
Author

dannylewis-sheffield commented Dec 2, 2016 via email

@kylef kylef closed this in e36d4f0 Dec 2, 2016
@kylef
Copy link
Owner

kylef commented Dec 2, 2016

Alright, I've made these public in e36d4f0. I wanted to expose these in a different way (on the new ClaimSet) structure instead of stand-alone functions. I've also exposed the date based validations too.

let claims = try JWT.decode("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.2_8pWJfyPup0YwOXK7g9Dn0cF1E3pdn299t4hSeJy5w", algorithm: .hs256("secret".data(using: .utf8)!), verify: false)
try claims.validateAudience("example.com")
try claims.validateIssuer("fuller.li")
try claims.validateExpiary()
try claims.validateNotBefore()
try claims.validateIssuedAt()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants